# include <stdio.h>
# include <conio.h>
# include <math.h>

double f0(double, double);
double f1(double, double);

void main()
{
  double e,x[2],x0[2],maxd;
  int i,j;
  printf("e=");
  scanf("%lg",&e);
  for (i=0;i<=1;i++)
  {
    printf("x%d=",i);
    scanf("%lg",&x[i]);
  };
  do
  {
    for (i=0;i<=1;i++)
      x0[i]=x[i];
    x[0]=f0(x0[0],x0[1]);
    x[1]=f1(x[0],x0[1]);
  }
  while((fabs(x[0]-x0[0])>e)||(fabs(x[1]-x0[1])>e));
  for (i=0;i<=1;i++)
    printf("\n x%d=%g",i,x[i]);

  getch();
};

double f0(double x0,double x1)
{
  return x0-0.5*cos(x1)-x0+1;
};

double f1(double x0,double x1)
{
  return x1+sin(x0+1)-x1-1.2;
};
